home *** CD-ROM | disk | FTP | other *** search
- /*
- ** Scroll Screen 336
- ** -----------------
- ** This demo allows you to legally scroll up to 50 screens in either
- ** direction by setting the HBUFFER flag. Normally we would blit blocks down
- ** the left and right hand side to give an impression of heaps of screens -
- ** maybe later...
- **
- */
-
- MODULE 'games','games/games'
-
- PROC main()
- DEF screen:PTR TO gamescreen, palette:PTR TO INT, zbxy:LONG,
- loadpic:PTR TO picture
-
- palette := [ $0000,$0130,$0FCB,$0FA9,$0D88,$0965,$0644,$0211,
- $0400,$0444,$0FF0,$0432,$0CC0,$0150,$0501,$0880,
- $0261,$0271,$0382,$0492,$05A3,$05B4,$0677,$06C4,
- $0788,$09AA,$0BCC,$0801,$0901,$0A02,$0701,$0601
- ]:INT;
-
- screen := [ GSV1,0,
- 0,0,0, -> Screen_Mem1/2/3
- 0, -> Screen link.
- palette, -> Address of palette.
- 0, -> Address of rasterlist.
- 0, -> Amt of colours in palette.
- 320,256,336,256, -> Screen & Pic Height/Width
- 5, -> Amt of planes.
- 0,0, -> Top of screen offsets, X/Y
- 0,0, -> X/Y counters (for scrolling).
- HSCROLL OR HBUFFER, -> Special attributes.
- LORES, -> Screen mode.
- INTERLEAVED, -> Screen type
- 0 -> Reserved.
- ]:gamescreen;
-
- loadpic := [ PCV1,0, -> Version header.
- 0, -> Destination.
- 336,256, -> Width, Height.
- 5, -> Amount of Planes.
- 32, -> Amount of colours.
- palette, -> Palette (remap).
- LORES, -> Screen mode.
- INTERLEAVED, -> Destination.
- 0 -> Parameters.
- ]:picture;
-
- IF gmsbase := OpenLibrary('games.library',0)
- SetUserPri()
- IF (Add_Screen(screen) = ERR_OK)
- loadpic.data := screen.memptr1;
- IF (LoadPic('GAMESLIB:data/IFF.Pic336',loadpic) = ERR_OK)
- Show_Screen(screen)
- Read_Mouse(JPORT1) -> Initialise mouse port.
-
- REPEAT
- zbxy := Read_Mouse(JPORT1)
- screen.picxoffset := screen.picxoffset+getZBXYx(zbxy)
- Move_Picture(screen)
- Wait_OSVBL()
- UNTIL !(zbxy AND MB_LMB)
-
- ENDIF
- Delete_Screen(screen)
- ENDIF
- CloseLibrary(gmsbase)
- ENDIF
- ENDPROC
-